<?php
class User extends AppModel {

	var $name = 'User';
	var $validate = array(	'login' => array('alphaNumeric' => array(
									 'rule' => 'alphaNumeric',
									 'required' => true,
									 'message' => 'Alphabets and numbers only'),
									 'between' => array('rule' => array('between', 5, 15),
									 'message' => 'Between 5 to 15 characters')),

							 'email' => 'email',


							'password' => array('rule' => array('confirmPassword', 'password'),
									'message' => 'Passwords do not match'),

        					'password_confirm' => array('rule' => 'alphanumeric',
									'required' => true),
							'country_id' => array('notempty')

	);
	
	var $validateProfile_infos = array('country_id' => array('notempty'));

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Group' => array(
			'className' => 'Group',
			'foreignKey' => 'group_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Country' => array(
			'className' => 'Country',
			'foreignKey' => 'country_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasMany = array(
		'Follow' => array(
			'className' => 'Follow',
			'foreignKey' => 'user_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'Licitation' => array(
			'className' => 'Licitation',
			'foreignKey' => 'user_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'Sale' => array(
			'className' => 'Sale',
			'foreignKey' => 'user_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
?>